package com.ugtss.busniess.controller;

import com.ugtss.busniess.domain.dto.RecruitDto;
import com.ugtss.busniess.service.RecruitService;
import com.ugtss.common.annotation.Anonymous;
import com.ugtss.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/recruit")
public class RecruitController {

    @Autowired
    private RecruitService recruitService;

    @PostMapping("/insert")
    public R insertRecruit(@RequestBody() @Validated RecruitDto dto) {
        recruitService.insertRecruit(dto);
        return R.ok();
    }

    @PutMapping
    public R updateRecruit(@RequestBody() @Validated RecruitDto dto) {
        recruitService.updateRecruit(dto);
        return R.ok();
    }

    @DeleteMapping("/{id}")
    public R deleteRecruit(@PathVariable("id") Integer id) {
        recruitService.deleteRecruit(id);
        return R.ok();
    }

}
